function doSearch() {
	$('#tt').datagrid('load', {
		isDelete : $('#isDelete').combobox('getValue')
	});
}


function add() {
	showMyWindow('模拟配置管理 |模拟新增配置管理', '/daemonapk/addConfig', 800, 500);
}

function phoneTypeEdit() {
	var row = $('#tt').datagrid('getSelected');
	if (row){
	    showMyWindow('修改手机类型 | 修改', '/daemonapk/'+row.id+'/phoneTypeEdit', 400, 350);
    } else {
    	showMsg(market.content.title, market.content.tips, alert);
    }
}

function abandon() {
	var row = $('#tt').datagrid('getSelected');
	var mark = row.mark;
	$.messager.confirm('温馨提醒', '你确定废弃本条数据吗？', function(r) {
		if (r) {
			$.get('/daemonapk/abandon?mark=' + mark, function(data) {
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					doSearch();
				} else if (data.return_code == '3') {
					top.showMsg(market.content.title, data.return_msg, alert);
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			});
		}
	});
}

function effect() {
	var row = $('#tt').datagrid('getSelected');
	var mark = row.mark;
	$.messager.confirm('温馨提醒', '你确定启用本条数据吗？', function(r) {
		if (r) {
			$.get('/daemonapk/effect?mark=' + mark, function(data) {
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					doSearch();
				} else if (data.return_code == '3') {
					top.showMsg(market.content.title, data.return_msg, alert);
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			});
		}
	});
}

function formatterType(value) {
	if (value == 0) {
		return "启用";
	}
	if (value == 1) {
		return "作废";
	}
}

function formatterPhone(value) {
	if (value == 1) {
		return "谷歌";
	}
	if (value == 2) {
		return "小米";
	}
	if (value == 3) {
		return "CT";
	}
}
